/*
 hemaPHP Install SQL
 Date: 2021-05-01 22:11:09
*/

SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for hm_applet_page
-- ----------------------------
DROP TABLE IF EXISTS `hm_applet_page`;
CREATE TABLE `hm_applet_page` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户id',
  `is_home` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否为首页',
  `page_data` longtext NOT NULL COMMENT '页面数据',
  `formwork_order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '模板id',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='小程序页面表';

-- ----------------------------
-- Table structure for hm_applet_user
-- ----------------------------
DROP TABLE IF EXISTS `hm_applet_user`;
CREATE TABLE `hm_applet_user` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户id',
  `union_id` varchar(255) NOT NULL DEFAULT '' COMMENT '开放平台唯一标示',
  `open_id` varchar(255) NOT NULL DEFAULT '' COMMENT '微信openid(唯一标示)',
  `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '微信昵称',
  `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '微信头像',
  `gender` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '性别',
  `country` varchar(50) NOT NULL DEFAULT '' COMMENT '国家',
  `province` varchar(50) NOT NULL DEFAULT '' COMMENT '省份',
  `city` varchar(50) NOT NULL DEFAULT '' COMMENT '城市',
  `address_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '默认收货地址',
  `money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '钱包余额',
  `pay` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消费金额',
  `score` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户积分',
  `converted` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '已兑换积分',
  `v` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '会员等级',
  `mobile` varchar(15) NOT NULL DEFAULT '' COMMENT '手机号码',
  `birthday` varchar(50) NOT NULL DEFAULT '' COMMENT '会员生日',
  `login_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `applet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
  `formwork_order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '模板id',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='小程序用户表';

-- ----------------------------
-- Table structure for hm_address
-- ----------------------------
DROP TABLE IF EXISTS `hm_address`;
CREATE TABLE `hm_address` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(30) NOT NULL DEFAULT '' COMMENT '收货人姓名',
  `phone` varchar(20) NOT NULL DEFAULT '' COMMENT '联系电话',
  `location` varchar(50) NOT NULL DEFAULT '' COMMENT '位置坐标',
  `province` varchar(20) NOT NULL DEFAULT '' COMMENT '所在省份',
  `city` varchar(20) NOT NULL DEFAULT '' COMMENT '所在城市',
  `district` varchar(20) NOT NULL DEFAULT '' COMMENT '所在区/县',
  `detail` varchar(255) NOT NULL DEFAULT '' COMMENT '详细地址',
  `applet_user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='用户地址表';

-- ----------------------------
-- Table structure for hm_setting
-- ----------------------------
DROP TABLE IF EXISTS `hm_setting`;
CREATE TABLE `hm_setting` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号ID',
  `setting_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '设置类型(10小程序 20模板)',
  `key` varchar(30) NOT NULL COMMENT '设置项标示',
  `describe` varchar(255) NOT NULL DEFAULT '' COMMENT '设置项描述',
  `values` mediumtext NOT NULL COMMENT '设置内容（json格式）',
  `applet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
  `formwork_order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '模板id',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='应用设置表';

-- ----------------------------
-- Table structure for hm_user_detail
-- ----------------------------
DROP TABLE IF EXISTS `hm_user_detail`;
CREATE TABLE `hm_user_detail` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号ID',
  `mchid` varchar(50) NOT NULL DEFAULT '' COMMENT '微信支付商户号',
  `id_card_copy` varchar(100) NOT NULL DEFAULT '' COMMENT '身份证正面',
  `id_card_national` varchar(100) NOT NULL DEFAULT '' COMMENT '身份证反面',
  `id_card_name` varchar(50) NOT NULL DEFAULT '' COMMENT '证件姓名',
  `id_card_number` varchar(50) NOT NULL DEFAULT '' COMMENT '证件号码',
  `legal_persona_wechat` varchar(50) NOT NULL DEFAULT '' COMMENT '微信号',
  `mobile_phone` varchar(50) NOT NULL DEFAULT '' COMMENT '手机号',
  `contact_email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱',
  `subject_type` varchar(50) NOT NULL DEFAULT 'SUBJECT_TYPE_INDIVIDUAL' COMMENT '主体类型',
  `license_copy` varchar(100) NOT NULL DEFAULT '' COMMENT '营业执照',
  `merchant_name` varchar(50) NOT NULL DEFAULT '' COMMENT '营业执照名称',
  `license_number` varchar(50) NOT NULL DEFAULT '' COMMENT '统一社会信用代码',
  `qualifications` varchar(50) NOT NULL DEFAULT '' COMMENT '特殊资质',
  `bank_name` varchar(100) NOT NULL DEFAULT '' COMMENT '开户银行全称',
  `account_number` varchar(50) NOT NULL DEFAULT '' COMMENT '银行账号',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='用户资料表';

-- ----------------------------
-- Table structure for hm_apply
-- ----------------------------
DROP TABLE IF EXISTS `hm_apply`;
CREATE TABLE `hm_apply` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号ID',
  `apply_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '认证类型(10入驻 20支付 30代理 40实名 50小程序注册)',
  `app_mode` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '小程序类型(10微信 20支付宝)',
  `applet_id` varchar(50) NOT NULL DEFAULT '' COMMENT '小程序ID',
  `mchid` varchar(50) NOT NULL DEFAULT '' COMMENT '支付商户号',
  `pay_mode` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '支付类型(10微信 20支付宝)',
  `merchant_shortname` varchar(50) NOT NULL DEFAULT '' COMMENT '商户简称',
  `app_id` varchar(50) NOT NULL DEFAULT '' COMMENT '小程序AppID',
  `auth_mode` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '认证类型(10工商 20个人)',
  `agent_mode` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '代理级别(10 区县 20 市级 30 省级)',
  `location` varchar(50) NOT NULL DEFAULT '' COMMENT '位置坐标',
  `province` varchar(20) NOT NULL DEFAULT '' COMMENT '所在省份',
  `city` varchar(20) NOT NULL DEFAULT '' COMMENT '所在城市',
  `district` varchar(20) NOT NULL DEFAULT '' COMMENT '所在区/县',
  `reject` varchar(255) NOT NULL DEFAULT '' COMMENT '驳回原因',
  `status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '审核状态(10待审核，20验证中，30已审核，40已驳回)',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '申请人ID',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='用户申请表';

-- ----------------------------
-- Table structure for hm_formwork_order
-- ----------------------------
DROP TABLE IF EXISTS `hm_formwork_order`;
CREATE TABLE `hm_formwork_order` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号ID',
  `order_no` varchar(50) NOT NULL DEFAULT '' COMMENT '订单号',
  `formwork_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '模板id',
  `shop_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '门店类型（10单 20多）',
  `pay_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实付金额',
  `pay_status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '付款状态（10未付 20已付）',
  `pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '付款时间',
  `transaction_id` varchar(50) NOT NULL DEFAULT '' COMMENT '微信支付交易号',
  `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  `applet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
  `expires_in` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '到期时间',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='模板订单表';

-- ----------------------------
-- Table structure for hm_formwork
-- ----------------------------
DROP TABLE IF EXISTS `hm_formwork`;
CREATE TABLE `hm_formwork` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号ID',
  `image` varchar(100) DEFAULT '' COMMENT '图片',
  `title` varchar(100) NOT NULL DEFAULT '' COMMENT '模板标题',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '模板包名',
  `is_many` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否支持多门店',
  `single_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '单门店购买价格',
  `line_single_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '单门店划线价格',
  `many_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '多门店购买价格',
  `line_many_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '单门店划线价格',
  `trial_day` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '试用天数',
  `agent_single_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '单门店代理价',
  `agent_many_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '多门店代理价',
  `sale_initial` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '初始销量',
  `sale_actual` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '真实销量',
  `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态(1上架 0下架)',
  `weigh` int(11) NOT NULL DEFAULT '0' COMMENT '权重',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='模板市场表';

-- ----------------------------
-- Table structure for hm_formwork_version
-- ----------------------------
DROP TABLE IF EXISTS `hm_formwork_version`;
CREATE TABLE `hm_formwork_version` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号ID',
  `formwork_id` int(11) NOT NULL DEFAULT '0' COMMENT '我的模板ID',
  `draft_id` int(11) NOT NULL DEFAULT '0' COMMENT '草稿ID',
  `template_id` int(11) NOT NULL DEFAULT '0' COMMENT '模板ID',
  `version` varchar(50) NOT NULL DEFAULT '' COMMENT '版本号',
  `desc` varchar(100) NOT NULL DEFAULT '' COMMENT '版本描述',
  `show` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='模板版本表';


-- ----------------------------
-- Table structure for hm_applet
-- ----------------------------
DROP TABLE IF EXISTS `hm_applet`;
CREATE TABLE `hm_applet` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号ID',
  `app_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '小程序类型（10微信 20公众号）',
  `app_name` varchar(50) NOT NULL DEFAULT '' COMMENT '小程序名称',
  `head_img` varchar(255) NOT NULL DEFAULT '' COMMENT '小程序头像',
  `qrcode_url` varchar(255) NOT NULL DEFAULT '' COMMENT '小程序二维码',
  `user_name` varchar(50) NOT NULL DEFAULT '' COMMENT '原始ID',
  `app_id` varchar(50) NOT NULL DEFAULT '' COMMENT '小程序AppID',
  `principal_name` varchar(255) NOT NULL DEFAULT '' COMMENT '主体名称',
  `api_domain` varchar(255) NOT NULL DEFAULT '' COMMENT '服务器域名',
  `signature` varchar(255) NOT NULL DEFAULT '' COMMENT '功能介绍',
  `formwork_version_id` int(11) NOT NULL DEFAULT '0' COMMENT '模板版本ID',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态（0未授权 1已授权）',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='小程序表';

-- ----------------------------
-- Table structure for hm_applet_token
-- ----------------------------
DROP TABLE IF EXISTS `hm_applet_token`;
CREATE TABLE `hm_applet_token` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号ID',
  `token_type` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '类型（10微信）',
  `access_token` varchar(255) NOT NULL DEFAULT '' COMMENT '令牌凭证',
  `expires_in` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '令牌到期时间',
  `verify_ticket` varchar(1000) NOT NULL DEFAULT '' COMMENT 'ticket',
  `authorizer_refresh_token` varchar(255) NOT NULL DEFAULT '' COMMENT '刷新令牌',
  `applet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序ID',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='应用token表';


-- ----------------------------
-- Table structure for hm_admin
-- ----------------------------
DROP TABLE IF EXISTS `hm_admin`;
CREATE TABLE `hm_admin` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `username` varchar(20) DEFAULT '' COMMENT '用户名',
  `nickname` varchar(50) DEFAULT '' COMMENT '昵称',
  `password` varchar(32) DEFAULT '' COMMENT '密码',
  `salt` varchar(30) DEFAULT '' COMMENT '密码盐',
  `avatar` varchar(255) DEFAULT '' COMMENT '头像',
  `email` varchar(100) DEFAULT '' COMMENT '电子邮箱',
  `token` varchar(59) DEFAULT '' COMMENT 'Session标识',
  `status` varchar(30) NOT NULL DEFAULT 'normal' COMMENT '状态',
  `loginfailure` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '失败次数',
  `logintime` int(10) DEFAULT NULL COMMENT '登录时间',
  `loginip` varchar(50) DEFAULT NULL COMMENT '登录IP',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='管理员表';

-- ----------------------------
-- Records of hm_admin
-- ----------------------------
BEGIN;
INSERT INTO `hm_admin` VALUES (1, 'admin', 'Admin', '', '', '/assets/img/avatar.png', 'admin@admin.com', '', 'normal', 0, 1491635035, '127.0.0.1',1491635035, 1491635035);
COMMIT;

-- ----------------------------
-- Table structure for hm_admin_log
-- ----------------------------
DROP TABLE IF EXISTS `hm_admin_log`;
CREATE TABLE `hm_admin_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID',
  `username` varchar(30) DEFAULT '' COMMENT '管理员名字',
  `url` varchar(1500) DEFAULT '' COMMENT '操作页面',
  `title` varchar(100) DEFAULT '' COMMENT '日志标题',
  `content` text NOT NULL COMMENT '内容',
  `ip` varchar(50) DEFAULT '' COMMENT 'IP',
  `useragent` varchar(255) DEFAULT '' COMMENT 'User-Agent',
  `createtime` int(10) DEFAULT NULL COMMENT '操作时间',
  PRIMARY KEY (`id`),
  KEY `name` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='管理员日志表';

-- ----------------------------
-- Table structure for hm_area
-- ----------------------------
DROP TABLE IF EXISTS `hm_area`;
CREATE TABLE `hm_area` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `pid` int(10) DEFAULT NULL COMMENT '父id',
  `shortname` varchar(100) DEFAULT NULL COMMENT '简称',
  `name` varchar(100) DEFAULT NULL COMMENT '名称',
  `mergename` varchar(255) DEFAULT NULL COMMENT '全称',
  `level` tinyint(4) DEFAULT NULL COMMENT '层级 0 1 2 省市区县',
  `pinyin` varchar(100) DEFAULT NULL COMMENT '拼音',
  `code` varchar(100) DEFAULT NULL COMMENT '长途区号',
  `zip` varchar(100) DEFAULT NULL COMMENT '邮编',
  `first` varchar(50) DEFAULT NULL COMMENT '首字母',
  `lng` varchar(100) DEFAULT NULL COMMENT '经度',
  `lat` varchar(100) DEFAULT NULL COMMENT '纬度',
  PRIMARY KEY (`id`),
  KEY `pid` (`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='地区表';

-- ----------------------------
-- Table structure for hm_attachment
-- ----------------------------
DROP TABLE IF EXISTS `hm_attachment`;
CREATE TABLE `hm_attachment` (
  `id` int(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID',
  `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `url` varchar(255) DEFAULT '' COMMENT '物理路径',
  `imagewidth` varchar(30) DEFAULT '' COMMENT '宽度',
  `imageheight` varchar(30) DEFAULT '' COMMENT '高度',
  `imagetype` varchar(30) DEFAULT '' COMMENT '图片类型',
  `imageframes` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '图片帧数',
  `filename` varchar(100) DEFAULT '' COMMENT '文件名称',
  `filesize` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '文件大小',
  `mimetype` varchar(100) DEFAULT '' COMMENT 'mime类型',
  `storage` varchar(100) NOT NULL DEFAULT 'local' COMMENT '存储位置',
  `sha1` varchar(40) DEFAULT '' COMMENT '文件 sha1编码',
  `extparam` varchar(255) DEFAULT '' COMMENT '透传数据',
  `uploadtime` int(10) DEFAULT NULL COMMENT '上传时间',
  `createtime` int(10) DEFAULT NULL COMMENT '创建日期',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='附件表';

-- ----------------------------
-- Records of hm_attachment
-- ----------------------------
BEGIN;
INSERT INTO `hm_attachment` VALUES (1, 1, 0, '/assets/img/qrcode.png', '150', '150', 'png', 0, 'qrcode.png', 21859, 'image/png', '', 'local', '17163603d0263e4838b9387ff2cd4877e8b018f6', 1491635035, 1491635035, 1491635035);
COMMIT;

-- ----------------------------
-- Table structure for hm_auth_group
-- ----------------------------
DROP TABLE IF EXISTS `hm_auth_group`;
CREATE TABLE `hm_auth_group` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父组别',
  `name` varchar(100) DEFAULT '' COMMENT '组名',
  `rules` text NOT NULL COMMENT '规则ID',
  `status` varchar(30) DEFAULT '' COMMENT '状态',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='分组表';

-- ----------------------------
-- Records of hm_auth_group
-- ----------------------------
BEGIN;
INSERT INTO `hm_auth_group` VALUES (1, 0, 'Admin group', '*', 'normal', 1491635035, 1491635035);
COMMIT;

-- ----------------------------
-- Table structure for hm_auth_group_access
-- ----------------------------
DROP TABLE IF EXISTS `hm_auth_group_access`;
CREATE TABLE `hm_auth_group_access` (
  `uid` int(10) unsigned NOT NULL COMMENT '会员ID',
  `group_id` int(10) unsigned NOT NULL COMMENT '级别ID',
  UNIQUE KEY `uid_group_id` (`uid`,`group_id`),
  KEY `uid` (`uid`),
  KEY `group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='权限分组表';

-- ----------------------------
-- Records of hm_auth_group_access
-- ----------------------------
BEGIN;
INSERT INTO `hm_auth_group_access` VALUES (1, 1);
COMMIT;

-- ----------------------------
-- Table structure for hm_auth_rule
-- ----------------------------
DROP TABLE IF EXISTS `hm_auth_rule`;
CREATE TABLE `hm_auth_rule` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('menu','file') NOT NULL DEFAULT 'file' COMMENT 'menu为菜单,file为权限节点',
  `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父ID',
  `name` varchar(100) DEFAULT '' COMMENT '规则名称',
  `title` varchar(50) DEFAULT '' COMMENT '规则名称',
  `icon` varchar(50) DEFAULT '' COMMENT '图标',
  `url` varchar(255) DEFAULT '' COMMENT '规则URL',
  `condition` varchar(255) DEFAULT '' COMMENT '条件',
  `remark` varchar(255) DEFAULT '' COMMENT '备注',
  `ismenu` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否为菜单',
  `menutype` enum('addtabs','blank','dialog','ajax') DEFAULT NULL COMMENT '菜单类型',
  `extend` varchar(255) DEFAULT '' COMMENT '扩展属性',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  `status` varchar(30) DEFAULT '' COMMENT '状态',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`) USING BTREE,
  KEY `pid` (`pid`),
  KEY `weigh` (`weigh`)
) ENGINE=InnoDB AUTO_INCREMENT=113 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='节点表';

-- ----------------------------
-- Records of hm_auth_rule
-- ----------------------------
BEGIN;
INSERT INTO `hm_auth_rule` VALUES (1, 'file', 0, 'dashboard', 'Dashboard', 'fa fa-dashboard', '', '', 'Dashboard tips', 1, NULL, '', 200, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (2, 'file', 0, 'general', 'General', 'fa fa-cogs', '', '', '', 1, NULL, '', 100, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (3, 'file', 0, 'category', 'Category', 'fa fa-leaf', '', '', 'Category tips', 1, NULL, '', 90, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (4, 'file', 0, 'addon', 'Addon', 'fa fa-rocket', '', '', 'Addon tips', 1, NULL, '', 80, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (5, 'file', 0, 'auth', 'Auth', 'fa fa-group', '', '', '', 1, NULL, '', 70, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (6, 'file', 2, 'general/config', 'Config', 'fa fa-cog', '', '', 'Config tips', 1, NULL, '', 60, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (7, 'file', 2, 'general/link', 'Link', 'fa fa-chain', '', '', '', 1, NULL, '', 40, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (8, 'file', 2, 'general/attachment', 'Attachment', 'fa fa-file-image-o', '', '', 'Attachment tips', 1, NULL, '', 30, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (9, 'file', 2, 'general/profile', 'Profile', 'fa fa-user', '', '', '', 1, NULL, '', 20, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (10, 'file', 5, 'auth/admin', 'Admin', 'fa fa-user', '', '', 'Admin tips', 1, NULL, '', 118, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (11, 'file', 5, 'auth/adminlog', 'Admin log', 'fa fa-list-alt', '', '', 'Admin log tips', 1, NULL, '', 113, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (12, 'file', 5, 'auth/group', 'Group', 'fa fa-group', '', '', 'Group tips', 1, NULL, '', 109, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (13, 'file', 5, 'auth/rule', 'Rule', 'fa fa-bars', '', '', 'Rule tips', 1, NULL, '', 104, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (14, 'file', 1, 'dashboard/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 136, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (15, 'file', 1, 'dashboard/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 135, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (16, 'file', 1, 'dashboard/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 133, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (17, 'file', 1, 'dashboard/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 134, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (18, 'file', 1, 'dashboard/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 132, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (19, 'file', 6, 'general/config/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 52, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (20, 'file', 6, 'general/config/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 51, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (21, 'file', 6, 'general/config/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 50, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (22, 'file', 6, 'general/config/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 49, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (23, 'file', 6, 'general/config/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 48, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (24, 'file', 7, 'general/link/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 59, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (25, 'file', 7, 'general/link/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 57, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (26, 'file', 7, 'general/link/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 56, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (27, 'file', 7, 'general/link/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 55, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (28, 'file', 7, 'general/link/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 54, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (29, 'file', 8, 'general/attachment/index', 'View', 'fa fa-circle-o', '', '', 'Attachment tips', 0, NULL, '', 59, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (30, 'file', 8, 'general/attachment/select', 'Select attachment', 'fa fa-circle-o', '', '', '', 0, NULL, '', 58, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (31, 'file', 8, 'general/attachment/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 57, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (32, 'file', 8, 'general/attachment/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 56, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (33, 'file', 8, 'general/attachment/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 55, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (34, 'file', 8, 'general/attachment/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 54, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (35, 'file', 9, 'general/profile/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 33, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (36, 'file', 9, 'general/profile/update', 'Update profile', 'fa fa-circle-o', '', '', '', 0, NULL, '', 32, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (37, 'file', 9, 'general/profile/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 31, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (38, 'file', 9, 'general/profile/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 30, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (39, 'file', 9, 'general/profile/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 29, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (40, 'file', 9, 'general/profile/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 28, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (41, 'file', 3, 'category/index', 'View', 'fa fa-circle-o', '', '', 'Category tips', 0, NULL, '', 142, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (42, 'file', 3, 'category/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 141, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (43, 'file', 3, 'category/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 140, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (44, 'file', 3, 'category/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 139, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (45, 'file', 3, 'category/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 138, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (46, 'file', 10, 'auth/admin/index', 'View', 'fa fa-circle-o', '', '', 'Admin tips', 0, NULL, '', 117, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (47, 'file', 10, 'auth/admin/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 116, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (48, 'file', 10, 'auth/admin/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 115, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (49, 'file', 10, 'auth/admin/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 114, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (50, 'file', 11, 'auth/adminlog/index', 'View', 'fa fa-circle-o', '', '', 'Admin log tips', 0, NULL, '', 112, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (51, 'file', 11, 'auth/adminlog/detail', 'Detail', 'fa fa-circle-o', '', '', '', 0, NULL, '', 111, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (52, 'file', 11, 'auth/adminlog/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 110, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (53, 'file', 12, 'auth/group/index', 'View', 'fa fa-circle-o', '', '', 'Group tips', 0, NULL, '', 108, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (54, 'file', 12, 'auth/group/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 107, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (55, 'file', 12, 'auth/group/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 106, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (56, 'file', 12, 'auth/group/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 105, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (57, 'file', 13, 'auth/rule/index', 'View', 'fa fa-circle-o', '', '', 'Rule tips', 0, NULL, '', 103, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (58, 'file', 13, 'auth/rule/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 102, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (59, 'file', 13, 'auth/rule/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 101, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (60, 'file', 13, 'auth/rule/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 100, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (61, 'file', 4, 'addon/index', 'View', 'fa fa-circle-o', '', '', 'Addon tips', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (62, 'file', 4, 'addon/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (63, 'file', 4, 'addon/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (64, 'file', 4, 'addon/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (65, 'file', 4, 'addon/downloaded', 'Local addon', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (66, 'file', 4, 'addon/state', 'Update state', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (67, 'file', 4, 'addon/config', 'Setting', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (68, 'file', 4, 'addon/refresh', 'Refresh', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (69, 'file', 4, 'addon/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (70, 'file', 0, 'user', 'User', 'fa fa-list', '', '', '', 1, NULL, '', 60, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (71, 'file', 70, 'user/user', 'User', 'fa fa-user', '', '', '', 1, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (72, 'file', 71, 'user/user/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (73, 'file', 71, 'user/user/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (74, 'file', 71, 'user/user/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (75, 'file', 71, 'user/user/del', 'Del', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (76, 'file', 71, 'user/user/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (77, 'file', 70, 'user/group', 'User group', 'fa fa-users', '', '', '', 1, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (78, 'file', 77, 'user/group/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (79, 'file', 77, 'user/group/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (80, 'file', 77, 'user/group/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (81, 'file', 77, 'user/group/del', 'Del', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (82, 'file', 77, 'user/group/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (83, 'file', 70, 'user/rule', 'User rule', 'fa fa-circle-o', '', '', '', 1, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (84, 'file', 83, 'user/rule/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (85, 'file', 83, 'user/rule/del', 'Del', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (86, 'file', 83, 'user/rule/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (87, 'file', 83, 'user/rule/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (88, 'file', 83, 'user/rule/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 0, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (89, 'file', 0, 'formwork', 'Formwork', 'fa fa-th-large', '', '', '', 1, NULL, '', 180, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (90, 'file', 89, 'formwork/lists', 'Formwork market', 'fa fa-send', '', '', '', 1, NULL, '', 90, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (91, 'file', 90, 'formwork/lists/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 59, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (92, 'file', 90, 'formwork/lists/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 57, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (93, 'file', 90, 'formwork/lists/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 56, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (94, 'file', 90, 'formwork/lists/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 55, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (95, 'file', 90, 'formwork/lists/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 54, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (96, 'file', 89, 'formwork/wxtpl', 'Wechat formwork', 'fa fa-wechat', '', '', '', 1, NULL, '', 80, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (97, 'file', 96, 'formwork/wxtpl/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 59, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (98, 'file', 96, 'formwork/wxtpl/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 56, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (99, 'file', 96, 'formwork/wxtpl/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 55, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (100, 'file', 96, 'formwork/wxtpl/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 54, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (101, 'file', 0, 'applet', 'Applet', 'fa fa-desktop', '', '', '', 1, NULL, '', 170, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (102, 'file', 101, 'applet/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 142, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (103, 'file', 101, 'applet/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 141, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (104, 'file', 101, 'applet/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 140, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (105, 'file', 101, 'applet/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 139, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (106, 'file', 101, 'applet/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 138, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (107, 'file', 0, 'apply', 'Apply record', 'fa fa-get-pocket', '', '', '', 1, NULL, '', 190, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (108, 'file', 107, 'apply/index', 'View', 'fa fa-circle-o', '', '', '', 0, NULL, '', 142, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (109, 'file', 107, 'apply/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', 141, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (110, 'file', 107, 'apply/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', 140, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (111, 'file', 107, 'apply/del', 'Delete', 'fa fa-circle-o', '', '', '', 0, NULL, '', 139, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_auth_rule` VALUES (112, 'file', 107, 'apply/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', 138, 'normal', 1491635035, 1491635035);
COMMIT;

-- ----------------------------
-- Table structure for hm_link
-- ----------------------------
DROP TABLE IF EXISTS `hm_link`;
CREATE TABLE `hm_link` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '站点名称',
  `url` varchar(255) NOT NULL DEFAULT '' COMMENT '站点地址',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  `createtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updatetime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='友情链接表';

INSERT INTO `hm_link` VALUES (1,'hemaPHP','https://www.hemaphp.com/',40,1580703326,1580744990);
INSERT INTO `hm_link` VALUES (2,'ThinkPHP','http://www.thinkphp.cn/',30,1580703326,1580744990);
INSERT INTO `hm_link` VALUES (3,'码云Gitee','https://gitee.com/',20,1580745030,1580745030);
INSERT INTO `hm_link` VALUES (4,'腾讯云','https://cloud.tencent.com/',10,1580745067,1580745067);

-- ----------------------------
-- Table structure for hm_category
-- ----------------------------
DROP TABLE IF EXISTS `hm_category`;
CREATE TABLE `hm_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父ID',
  `type` varchar(30) DEFAULT '' COMMENT '栏目类型',
  `name` varchar(30) DEFAULT '',
  `nickname` varchar(50) DEFAULT '',
  `flag` set('hot','index','recommend') DEFAULT '',
  `image` varchar(100) DEFAULT '' COMMENT '图片',
  `keywords` varchar(255) DEFAULT '' COMMENT '关键字',
  `description` varchar(255) DEFAULT '' COMMENT '描述',
  `diyname` varchar(30) DEFAULT '' COMMENT '自定义名称',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  `status` varchar(30) DEFAULT '' COMMENT '状态',
  PRIMARY KEY (`id`),
  KEY `weigh` (`weigh`,`id`),
  KEY `pid` (`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='分类表';


-- ----------------------------
-- Table structure for hm_config
-- ----------------------------
DROP TABLE IF EXISTS `hm_config`;
CREATE TABLE `hm_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) DEFAULT '' COMMENT '变量名',
  `group` varchar(30) DEFAULT '' COMMENT '分组',
  `title` varchar(100) DEFAULT '' COMMENT '变量标题',
  `tip` varchar(100) DEFAULT '' COMMENT '变量描述',
  `type` varchar(30) DEFAULT '' COMMENT '类型:string,text,int,bool,array,datetime,date,file',
  `value` text COMMENT '变量值',
  `content` text COMMENT '变量字典数据',
  `rule` varchar(100) DEFAULT '' COMMENT '验证规则',
  `extend` varchar(255) DEFAULT '' COMMENT '扩展属性',
  `setting` varchar(255) DEFAULT '' COMMENT '配置',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='系统配置';

-- ----------------------------
-- Records of hm_config
-- ----------------------------
BEGIN;
INSERT INTO `hm_config` VALUES (1, 'name', 'basic', 'Site name', '请填写站点名称', 'string', '河马云店', '', 'required', '', '');
INSERT INTO `hm_config` VALUES (2, 'company', 'basic', 'Company', '请填写公司名称', 'string', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (3, 'mobile', 'basic', 'Mobile', '请填写联系电话', 'string', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (4, 'address', 'basic', 'Address', '请填写联系地址', 'string', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (5, 'qq', 'basic', 'QQ', '请填写您的QQ号', 'string', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (6, 'description', 'basic', 'Description', '请填写站点描述', 'string', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (7, 'keywords', 'basic', 'Keywords', '请填写SEO关键字', 'string', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (8, 'beian', 'basic', 'Beian', '苏ICP备15000000号-1', 'string', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (9, 'cdnurl', 'basic', 'Cdn url', '如果全站静态资源使用第三方云储存请配置该值', 'string', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (10, 'qrcode', 'basic', '官方公众号', '请输入二维码链接', 'string', '/assets/img/qrcode.png', '', '', '', '');
INSERT INTO `hm_config` VALUES (11, 'version', 'basic', 'Version', '如果静态资源有变动请重新配置该值', 'string', '1.0.0', '', 'required', '', '');
INSERT INTO `hm_config` VALUES (12, 'timezone', 'basic', 'Timezone', '', 'string', 'Asia/Shanghai', '', 'required', '', '');
INSERT INTO `hm_config` VALUES (13, 'forbiddenip', 'basic', 'Forbidden ip', '一行一条记录', 'text', '', '', '', '', '');
INSERT INTO `hm_config` VALUES (14, 'languages', 'basic', 'Languages', '', 'array', '{\"backend\":\"zh-cn\",\"frontend\":\"zh-cn\"}', '', 'required', '', '');
INSERT INTO `hm_config` VALUES (15, 'fixedpage', 'basic', 'Fixed page', '请尽量输入左侧菜单栏存在的链接', 'string', 'dashboard', '', 'required', '', '');
INSERT INTO `hm_config` VALUES (16, 'categorytype', 'dictionary', 'Category type', '', 'array', '{\"default\":\"Default\",\"page\":\"Page\",\"article\":\"Article\",\"test\":\"Test\"}', '', '', '', '');
INSERT INTO `hm_config` VALUES (17, 'configgroup', 'dictionary', 'Config group', '', 'array', '{\"basic\":\"Basic\",\"email\":\"Email\",\"dictionary\":\"Dictionary\",\"user\":\"User\",\"example\":\"Example\"}', '', '', '', '');
INSERT INTO `hm_config` VALUES (18, 'mail_type', 'email', 'Mail type', '选择邮件发送方式', 'select', '1', '[\"请选择\",\"SMTP\"]', '', '', '');
INSERT INTO `hm_config` VALUES (19, 'mail_smtp_host', 'email', 'Mail smtp host', '错误的配置发送邮件会导致服务器超时', 'string', 'smtp.qq.com', '', '', '', '');
INSERT INTO `hm_config` VALUES (20, 'mail_smtp_port', 'email', 'Mail smtp port', '(不加密默认25,SSL默认465,TLS默认587)', 'string', '465', '', '', '', '');
INSERT INTO `hm_config` VALUES (21, 'mail_smtp_user', 'email', 'Mail smtp user', '（填写完整用户名）', 'string', '10000', '', '', '', '');
INSERT INTO `hm_config` VALUES (22, 'mail_smtp_pass', 'email', 'Mail smtp password', '（填写您的密码或授权码）', 'string', 'password', '', '', '', '');
INSERT INTO `hm_config` VALUES (23, 'mail_verify_type', 'email', 'Mail vertify type', '（SMTP验证方式[推荐SSL]）', 'select', '2', '[\"无\",\"TLS\",\"SSL\"]', '', '', '');
INSERT INTO `hm_config` VALUES (24, 'mail_from', 'email', 'Mail from', '', 'string', '10000@qq.com', '', '', '', '');
COMMIT;

-- ----------------------------
-- Table structure for hm_ems
-- ----------------------------
DROP TABLE IF EXISTS `hm_ems`;
CREATE TABLE `hm_ems`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `event` varchar(30) DEFAULT '' COMMENT '事件',
  `email` varchar(100) DEFAULT '' COMMENT '邮箱',
  `code` varchar(10) DEFAULT '' COMMENT '验证码',
  `times` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '验证次数',
  `ip` varchar(30) DEFAULT '' COMMENT 'IP',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='邮箱验证码表';

-- ----------------------------
-- Table structure for hm_sms
-- ----------------------------
DROP TABLE IF EXISTS `hm_sms`;
CREATE TABLE `hm_sms` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `event` varchar(30) DEFAULT '' COMMENT '事件',
  `mobile` varchar(20) DEFAULT '' COMMENT '手机号',
  `code` varchar(10) DEFAULT '' COMMENT '验证码',
  `times` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '验证次数',
  `ip` varchar(30) DEFAULT '' COMMENT 'IP',
  `createtime` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='短信验证码表';

-- ----------------------------
-- Table structure for hm_user
-- ----------------------------
DROP TABLE IF EXISTS `hm_user`;
CREATE TABLE `hm_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `group_id` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '组别ID',
  `union_id` varchar(50) NOT NULL DEFAULT '' COMMENT '微信开放平台识别号',
  `open_id` varchar(50) NOT NULL DEFAULT '' COMMENT '公众号openid(唯一标识)',
  `username` varchar(32) DEFAULT '' COMMENT '用户名',
  `password` varchar(32) DEFAULT '' COMMENT '密码',
  `salt` varchar(30) DEFAULT '' COMMENT '密码盐',
  `nickname` varchar(50) DEFAULT '' COMMENT '昵称',
  `avatar` varchar(255) DEFAULT '' COMMENT '头像',
  `linkman` varchar(20) NOT NULL DEFAULT '' COMMENT '联系人',
  `mobile` varchar(11) DEFAULT '' COMMENT '手机号',
  `email` varchar(100) DEFAULT '' COMMENT '电子邮箱',
  `level` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '等级',
  `gender` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别',
  `country` varchar(50) NOT NULL DEFAULT '' COMMENT '国家',
  `province` varchar(50) NOT NULL DEFAULT '' COMMENT '省份',
  `city` varchar(50) NOT NULL DEFAULT '' COMMENT '城市',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `bio` varchar(100) DEFAULT '' COMMENT '格言',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '余额',
  `score` int(10) NOT NULL DEFAULT '0' COMMENT '积分',
  `address_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '默认收货地址',
  `token` varchar(50) DEFAULT '' COMMENT 'Token',
  `status` varchar(30) DEFAULT '' COMMENT '状态',
  `successions` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '连续登录天数',
  `maxsuccessions` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '最大连续登录天数',
  `prevtime` int(10) DEFAULT NULL COMMENT '上次登录时间',
  `logintime` int(10) DEFAULT NULL COMMENT '登录时间',
  `loginip` varchar(50) DEFAULT '' COMMENT '登录IP',
  `loginfailure` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '失败次数',
  `joinip` varchar(50) DEFAULT '' COMMENT '加入IP',
  `jointime` int(10) DEFAULT NULL COMMENT '加入时间',
  `verification` varchar(255) DEFAULT '' COMMENT '验证',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `username` (`username`),
  KEY `email` (`email`),
  KEY `mobile` (`mobile`),
  KEY `union_id` (`union_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员表';

-- ----------------------------
-- Table structure for hm_user_group
-- ----------------------------
DROP TABLE IF EXISTS `hm_user_group`;
CREATE TABLE `hm_user_group` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT '' COMMENT '组名',
  `rules` text COMMENT '权限节点',
  `status` enum('normal','hidden') DEFAULT NULL COMMENT '状态',
  `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员组表';

-- ----------------------------
-- Records of hm_user_group
-- ----------------------------
BEGIN;
INSERT INTO `hm_user_group` VALUES (1, '默认组', '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15', 'normal', 1491635035, 1491635035);
COMMIT;

-- ----------------------------
-- Table structure for hm_user_money_log
-- ----------------------------
DROP TABLE IF EXISTS `hm_user_money_log`;
CREATE TABLE `hm_user_money_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更余额',
  `before` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更前余额',
  `after` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更后余额',
  `memo` varchar(255) DEFAULT '' COMMENT '备注',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员余额变动表';

-- ----------------------------
-- Table structure for hm_user_rule
-- ----------------------------
DROP TABLE IF EXISTS `hm_user_rule`;
CREATE TABLE `hm_user_rule` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(10) DEFAULT NULL COMMENT '父ID',
  `name` varchar(50) DEFAULT NULL COMMENT '名称',
  `url` varchar(100) DEFAULT NULL COMMENT '网址',
  `title` varchar(50) DEFAULT '' COMMENT '标题',
  `remark` varchar(100) DEFAULT NULL COMMENT '备注',
  `ismenu` tinyint(1) DEFAULT NULL COMMENT '是否菜单',
  `weigh` int(10) DEFAULT '0' COMMENT '权重',
  `status` enum('normal','hidden') DEFAULT NULL COMMENT '状态',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员规则表';

-- ----------------------------
-- Records of hm_user_rule
-- ----------------------------
BEGIN;
INSERT INTO `hm_user_rule` VALUES (1, 0, 'index', '', 'Frontend', '', 1, 10, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (2, 1, 'index/formwork/index', '', 'Formwork market', '', 1, 9, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (3, 1, 'user', '', 'User Module', '', 1, 1, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (4, 3, 'index/user/login', '', 'Login', '', 0, 10, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (5, 3, 'index/user/register', '', 'Register', '', 0, 9, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (6, 3, 'index/user/index', '', 'User Center', '', 0, 8, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (7, 3, 'index/user/profile', '', 'Profile', '', 0, 7, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (8, 1, 'order', '', 'My formwork', '', 0, 8, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (9, 8, 'index/order/index', '', 'View', '', 0, 7, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (10, 1, 'applet', '', 'My applet', '', 0, 7, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (11, 10, 'index/applet/index', '', 'View', '', 0, 7, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (12, 10, 'index/applet/add', '', 'Add', '', 0, 7, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (13, 10, 'index/applet/del', '', 'Del', '', 0, 7, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (14, 1, 'apply', '', 'My apply', '', 0, 6, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (15, 14, 'index/apply/index', '', 'View', '', 0, 7, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (16, 1, 'index/customer/index', '', 'Customer case', '', 1, 8, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (17, 1, 'index/regional/index', '', 'Regional cooperation', '', 1, 7, 'normal', 1491635035, 1491635035);
INSERT INTO `hm_user_rule` VALUES (18, 1, 'index/contact/index', '', 'Contact us', '', 1, 6, 'normal', 1491635035, 1491635035);
COMMIT;

-- ----------------------------
-- Table structure for hm_user_score_log
-- ----------------------------
DROP TABLE IF EXISTS `hm_user_score_log`;
CREATE TABLE `hm_user_score_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `score` int(10) NOT NULL DEFAULT '0' COMMENT '变更积分',
  `before` int(10) NOT NULL DEFAULT '0' COMMENT '变更前积分',
  `after` int(10) NOT NULL DEFAULT '0' COMMENT '变更后积分',
  `memo` varchar(255) DEFAULT '' COMMENT '备注',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员积分变动表';

-- ----------------------------
-- Table structure for hm_user_token
-- ----------------------------
DROP TABLE IF EXISTS `hm_user_token`;
CREATE TABLE `hm_user_token` (
  `token` varchar(50) NOT NULL COMMENT 'Token',
  `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `expiretime` int(10) DEFAULT NULL COMMENT '过期时间',
  PRIMARY KEY (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员Token表';

-- ----------------------------
-- Table structure for hm_version
-- ----------------------------
DROP TABLE IF EXISTS `hm_version`;
CREATE TABLE `hm_version`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `oldversion` varchar(30) DEFAULT '' COMMENT '旧版本号',
  `newversion` varchar(30) DEFAULT '' COMMENT '新版本号',
  `packagesize` varchar(30) DEFAULT '' COMMENT '包大小',
  `content` varchar(500) DEFAULT '' COMMENT '升级内容',
  `downloadurl` varchar(255) DEFAULT '' COMMENT '下载地址',
  `enforce` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '强制更新',
  `weigh` int(10) NOT NULL DEFAULT 0 COMMENT '权重',
  `status` varchar(30) DEFAULT '' COMMENT '状态',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='版本表';

SET FOREIGN_KEY_CHECKS = 1;
